/**
 * @description 全局自定义插件--全局组件、过滤器、指令
 */
// import MainLayout from './MainLayout.vue'
// import BlankLayout from './BlankLayout.vue'
const MainLayout = () => import('./MainLayout.vue')
const BlankLayout = () => import('./BlankLayout.vue')
const PageLayout = () => import('./PageLayout.vue')

const plugin = function(VC) {
    // 注册全局组件
    VC.component("MainLayout", MainLayout)
    VC.component("BlankLayout", BlankLayout)
    VC.component("PageLayout", PageLayout)

    // 注册全局过滤器
    VC.filter('typeFilter', function(val, types) {
        let dict = types.find(it => it.code === val)
        if (!dict) return val
        return dict.name
    })
}

export default plugin